let mongoose = require('mongoose'),
    member_users = new mongoose.Schema({
        uid: Number,
        userName: {
            type: String,
            default: '---',
            unique: true
        },
        passWord: {
            type: String,
            default: 'e10adc3949ba59abbe56e057f20f883e'
        },
        userGroup: {
            type: Number,
            default: 3
            // 0黑用户，1普通会员，2高级会员，3VIP会员，98管理员，99超级管理员
        },
        integral: { // 积分
            type: Number,
            default: 0
        },
        avater: {
            type: String,
            default: '/img/avater.jpg',
            // get: function(avater){
            //     if(!avater){
            //         return '/img/avater.jpg'
            //     }else{
            //         return avater
            //     }
            // }
        },
        sex: {
            type: String,
            default: '未知'
        },
        mobile: {
            type: String,
            unique: true
        },
        email: {
            type: String,
            unique: true
        },
        address: {
            type: Array,
            default: [String, String, String, String]
        },
        birthday: {
            type: String,
            default: '1990-01-01'
        },
        speciality: String,     // 擅长画种
        comeFrom: String,       // 机构名
        autograph: {    //签名
            type: String,
            default: '这家伙很懒，什么都没留下！',
            // get: function(about){
            //     if(!about){
            //         return '这家伙很懒，什么都没留下！'
            //     }else{
            //         return about
            //     }
            // }
        },
        createTime: {
            type: Date,
            default: Date.now
        }
    });
mongoose.model('member_users', member_users);